<html>
  <head>
	<title>Simple DB</title>
    <link type="text/css" rel="stylesheet" href="/css/simpledb.css" />
  </head>

  <body>
	<h1>Simple DB</h1>
	
	<h3>What it does</h3>
	Simple DB is a nice and easy way to store temporary data of your mashup / javascript application. You send GET and POST requests to store and read your data.
	<br/>
	
	<h3>How to Use</h3>
	<ul>
		<li>
			To <strong>insert</strong> send a GET or POST request to: <strong>http://simpledb.appspot.com/put?content=....</strong><br/>
			Return value is a key which you can later use to update or read the value.<br/>
			For example using curl from a linux command line:
			<pre>
	$ curl http://simpledb.appspot.com/put?content=123
	aghzaW1wbGVkYnIKCxIESXRlbRgWDA
	$ 
			</pre>
		</li>
		<li>
			To <strong>read</strong> send a GET request to <strong>http://simpledb.appspot.com/get?key=....</strong><br/>
			Return value is the data you have for that key, or an empty string if there's nothing stored for the key.<br/>
			For example:
			<pre>
	$ curl http://simpledb.appspot.com/get?key=aghzaW1wbGVkYnIKCxIESXRlbRgWDA
	123
	$ 
			</pre>			
		</li>
		<li>
			To <strong>update</strong> send a GET or POST request to <strong>http://simpledb.appspot.com/put?key=....&amp;content=....</strong><br/>
			Return value is a key which you can later use to update or read the value.<br/>
			Note that if you provide a wrong key, it will be ignored and a new item will be inserted instead (which means you will get a new key in the response)<br/>
			For example:
			<pre>
	$ curl http://simpledb.appspot.com/put?key=aghzaW1wbGVkYnIKCxIESXRlbRgWDA&content=456
	aghzaW1wbGVkYnIKCxIESXRlbRgWDA
	$ curl http://simpledb.appspot.com/get?key=aghzaW1wbGVkYnIKCxIESXRlbRgWDA
	456
	$ 
			</pre>			
		</li>
	</ul>
	<br/>
	
	<h3>FAQ</h3>
	<ol>
		<li>
			Q: For how long will Simple DB keep my data?<br/>
			A: You should not think of Simple DB as a long term storage solution - nevertheless it will keep your data for at least a few months.
		</li>
		<li>
			Q: Should I store sensitive data in Simple DB?<br/>
			A: No. It's not safe to store sensitive data on Simple DB (at least not for now)
		</li>
	</ol>
	
	<br/>
	<h3>Last 10 Items</h3>
	<ol>	
    {% for item in items %}
      <li><a href='edit?key={{item.key}}'>{{ item.content|escape }}</a></li>
    {% endfor %}
	</ol>

    <form action="/put" method="post">
	  <input type="hidden" name="ui" value="true" />
      <div><textarea name="content" rows="3" cols="60"></textarea></div>
      <div><input type="submit" value="Add Item"></div>
    </form>

	<br/>
	<br/>
	<img src="http://code.google.com/appengine/images/appengine-noborder-120x30.gif" alt="Powered by Google App Engine" />
  </body>
</html>
